﻿using System;

public class Clock
{
    public event EventHandler Tick;
    public event EventHandler Alarm;

    public void Start()
    {
        for (int i = 0; i < 10; i++)
        {
            OnTick();
            System.Threading.Thread.Sleep(1000);
        }

        OnAlarm();
    }

    protected virtual void OnTick()
    {
        Tick?.Invoke(this, EventArgs.Empty);
    }

    protected virtual void OnAlarm()
    {
        Alarm?.Invoke(this, EventArgs.Empty);
    }
}

public class Program
{
    public static void Main()
    {
        Clock clock = new Clock();

        clock.Tick += (sender, args) => Console.WriteLine("Tick...");
        clock.Alarm += (sender, args) => Console.WriteLine("Alarm! Wake up!");

        clock.Start();
    }
}
